x86: Make assigned devices' interrupts delivery to right vcpu.
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 25 Sep 2009 09:50:18 +0000 (10:50 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 25 Sep 2009 09:50:18 +0000 (10:50 +0100)
commit023e3bc72dc37d41f952e1c721c6ab4bf9370015
treea79724ef1908e734daaa0aa9f766869e1d615ae2
parent66b5d8857c82567041d5d1657af26729e78b4c48
x86: Make assigned devices' interrupts delivery to right vcpu.

This patch targets for reducing IPIs when delivery VT-d's devices'
intrs to target vcpus.  According to the experiments leveraging 10G
Oplin NIC card, CPU utilization can reduce 5%-6% and NIC's bandwidth
keeps unchanged through testings.  And this patch can always benefit
UP guests with MSI-capable devices assigned and SMP guests whose
lapic's destination mode is physical mode.  And also it can benefit
SMP guests whose lapic's dest_mode is logical mode but only one
destination is specified.  So it should cover major cases in real
environment. Currenlty, this patch intercepts the programming for MSI
intr status, and caculate the destination id for the pirq when do the
programming in advance.  When vcpu migratio n occurs or guest
re-programe MSI status, it checks that whether needs to set the
corresponding pirq's affinity of assigned devices and make vcpu's
affinity and pirq's consistent to reduce the IPIs eventually.

Signed-off-by : Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/vmsi.c
xen/arch/x86/hvm/vmx/vmcs.c
xen/arch/x86/irq.c
xen/drivers/passthrough/io.c
xen/include/asm-x86/hvm/hvm.h
xen/include/asm-x86/irq.h
xen/include/xen/hvm/irq.h